// src/router/index.js
import { createRouter, createWebHistory } from "vue-router";

import studentLogin from "@/components/studentLogin.vue";
import studentRegister from "@/components/studentRegister.vue";
import home from "@/components/home.vue";
import TrainingPlan from "@/components/TrainingPlan.vue";
import MyTrainingPlan from "@/components/MyTrainingPlan.vue";
import StudentTask from "@/components/StudentTask.vue";

import TaskDetails from "@/components/TaskDetails.vue";
import OnlineExam from "@/components/OnlineExam.vue";
import ExamResult from "@/components/ExamResult.vue";
import ExamRecord from "@/components/ExamRecord.vue";


const routes = [
    {
        path: '/exam-record',
        name: 'exam-record',
        component: ExamRecord,
        props: true  // 允许路由传递参数
    },
    {
        path: '/exam/:trainingPlanId',
        name: 'exam',
        component: OnlineExam,
        props: true  // 允许路由传递参数
    },
    {
        path: '/exam-result/:examRecordId',
        name: 'exam-result',
        component: ExamResult,
        props: true  // 允许路由传递参数
    },
    {
        path: "/task/:id",
        name: "task",
        component:TaskDetails ,
    },
    {
        path: "/studentTask",
        name: "studentTask",
        component:StudentTask ,
    },
    {
        path: "/myTraining",
        name: "myTraining",
        component:MyTrainingPlan ,
    },
    {
        path: "/train",
        name: "train",
        component:TrainingPlan ,
    },
    {
        path: "/",
        name: "studentLogin",
        component:studentLogin ,
    },
    {
        path: "/studentRegister",
        name: "studentRegister",
        component:studentRegister ,
    },
    {
        path: "/home",
        name: "home",
        component:home ,
    }
];



const router = createRouter({
    history: createWebHistory(),
    routes,
});

export default router;
